package com.fivemin.website_statistics.controller;

import com.fivemin.website_statistics.service.StatisticsService;
import com.fivemin.website_statistics.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
@CrossOrigin
public class StatisticsController {

    @Autowired
    private StatisticsService statisticsService;

    @GetMapping("/")
    public R statistics(@RequestParam("key")String key, HttpServletRequest httpServletRequest){
       return statisticsService.statistics(key,httpServletRequest);
    }




}
